bota_recipient/include/bota_defs.h File Reference

Common BOTA definitions. More...

Data Structures

struct  BotaTransferRequest
 Structure defining the TRANSFER.request packet. More...
 
struct  BotaTransferConfirmation
 Structure defining the TRANSFER.confirmation packet. More...
 
struct  BotaBulkWriteRequest
 Structure defining the BULK_WRITE.request packet. More...
 
struct  BotaBulkMissingRequest
 Structure defining the BULK_MISSING.request packet. More...
 
struct  BotaBulkMissingConfirmation
 Structure defining the BULK_MISSING.confirmation packet. More...
 
struct  BotaValidateRequest
 Structure defining the VALIDATE.request packet. More...
 
struct  BotaValidateConfirmation
 Structure defining the VALIDATE.confirmation packet. More...
 

Macros

#define BOTA_PACKED   __attribute__((packed))
 
#define BOTA_STATIC_ASSERT(...)   static_assert(__VA_ARGS__)
 
#define BOTA_SENDER_MAX_TRANSFERS   2
 Maximum number of simultaneous transfers that is supported. More...
 
#define BOTA_SENDER_MAX_MISSING_CHUNKS   100
 Maximum number of missing data chunks that can be tracked at once per transfer. More...
 
#define BOTA_RECIPIENT_MAX_TRANSFERS   2
 Maximum number of simultaneous transfers that is supported. More...
 
#define BOTA_RECIPIENT_MAX_MISSING_CHUNKS   50
 Maximum number of missing data chunks that can be tracked at once per transfer. More...
 
#define BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_INTERVAL_MS   45000
 BOTA timings - RECIPIENT. More...
 
#define BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_RANDOMIZATION_MS   15000
 BULK_MISSING.request randomization (first transmission of BULK_MISSING.request will be after randomized time) More...
 
#define BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_RETRIES   20
 how many times BULK_MISSING.request will be send until transfer abort More...
 
#define BOTA_RECIPIENT_TRANSFER_CONFIRMATION_SEND_RANDOMIZATION_MS   5000
 TRANSFER.confirmation randomization. More...
 
#define BOTA_RECIPIENT_VALIDATE_CONFIRMATION_SEND_RANDOMIZATION_MS   5000
 VALIDATE.confirmation randomization. More...
 
#define BOTA_RECIPIENT_TRANSFER_TIMEOUT_MS   (24 * 3600 * 1000)
 inactivity timeout during transfer that leads to aborting the transfer More...
 
#define BOTA_RECIPIENT_TRANSFER_OVERWRITE_TIMEOUT_MS   (5 * 60 * 1000)
 inactivity timeout during transfer that makes it possible to overwrite the transfer with new one More...
 
#define BOTA_SENDER_DEFAULT_BULK_WRITE_SENDING_INTERVAL_MS   3000
 Default timings for BOTA Sender. More...
 
#define BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_SENDING_DELAY_SEC   20
 Default TRANSFER.request sending delay (in seconds) after last TRANSFER.confirmation was received. More...
 
#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_PAUSE_SEC   60
 Default value of how long to wait (in seconds) from last BULK_WRITE.request to the first VALIDATE.request. More...
 
#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_SENDING_DELAY_SEC   20
 Default VALIDATE.request sending delay (in seconds) after last VALIDATE.confirmation was received. More...
 
#define BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_RETRIES   3
 Default setting of how many times TRANSFER.request will be sent. More...
 
#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_RETRIES   3
 Default setting of how many times VALIDATE.request will be sent. More...
 
#define BOTA_TRANSFER_INVALID   0
 Invalid transfer identifier. More...
 
#define BOTA_MAX_TRANSFER_INFO_SIZE   32
 Maximum size of the user data associated with the transfer. More...
 
#define BOTA_CHUNK_SIZE   72
 Size of a single data chunk sent in a single UDP packet. More...
 
#define BOTA_MAX_OFFSETS_IN_BULK_MISSING_REQUEST   18
 Maximum number of offsets in BULK_MISSING.request packet. More...
 
#define BOTA_DEFAULT_PORT   (0xf0b2)
 Default UDP port number for the BOTA service. More...
 
#define BOTA_SENDER_ESTIMATED_TRANSFER_DURATION(bulkSize)
 Helper macro to estimate total transfer duration (in ms) More...
 

Typedefs

typedef uint16_t BotaTransferId
 BOTA transfer identifier used to identify and distinguish the transfers. More...
 
typedef uint32_t BotaMemoryAddr
 Address in the Bulk memory. More...
 
typedef void(* BotaReadFunc) (BotaMemoryAddr addr, void *dst, size_t size, BotaTransferId transferId)
 
typedef void(* BotaWriteFunc) (BotaMemoryAddr addr, const void *src, size_t size, BotaTransferId transferId)
 
typedef uint64_t(* BotaTimeFunc) (void)
 

Enumerations

enum  BotaResult {
  BOTA_RESULT_OK = 0 , BOTA_RESULT_INVALID_INPUT_ARGUMENT = 1 , BOTA_RESULT_FAILED_TO_REGISTER_UDP_SOCKET = 2 , BOTA_RESULT_FAILED_TO_REGISTER_NEW_TRANSFER = 3 ,
  BOTA_RESULT_OK = 0 , BOTA_RESULT_INVALID_INPUT_ARGUMENT = 1 , BOTA_RESULT_FAILED_TO_REGISTER_UDP_SOCKET = 2 , BOTA_RESULT_FAILED_TO_REGISTER_NEW_TRANSFER = 3
}
 Possible BOTA function results. More...
 
enum  BotaTransferReaction {
  BOTA_TRANSFER_REACTION_ACCEPT , BOTA_TRANSFER_REACTION_REJECT , BOTA_TRANSFER_REACTION_MARK_AS_RECEIVED , BOTA_TRANSFER_REACTION_ACCEPT ,
  BOTA_TRANSFER_REACTION_REJECT , BOTA_TRANSFER_REACTION_MARK_AS_RECEIVED
}
 Possible recipient reactions to a new BOTA transfer. More...
 
enum  BotaPacketType {
  BOTA_PACKET_TYPE_TRANSFER_REQUEST = 0xB0 , BOTA_PACKET_TYPE_TRANSFER_CONFIRMATION = 0xB1 , BOTA_PACKET_TYPE_BULK_WRITE_REQUEST = 0xB4 , BOTA_PACKET_TYPE_BULK_MISSING_REQUEST = 0xB8 ,
  BOTA_PACKET_TYPE_BULK_MISSING_CONFIRMATION = 0xB9 , BOTA_PACKET_TYPE_VALIDATE_REQUEST = 0xBC , BOTA_PACKET_TYPE_VALIDATE_CONFIRMATION = 0xBD , BOTA_PACKET_TYPE_TRANSFER_REQUEST = 0xB0 ,
  BOTA_PACKET_TYPE_TRANSFER_CONFIRMATION = 0xB1 , BOTA_PACKET_TYPE_BULK_WRITE_REQUEST = 0xB4 , BOTA_PACKET_TYPE_BULK_MISSING_REQUEST = 0xB8 , BOTA_PACKET_TYPE_BULK_MISSING_CONFIRMATION = 0xB9 ,
  BOTA_PACKET_TYPE_VALIDATE_REQUEST = 0xBC , BOTA_PACKET_TYPE_VALIDATE_CONFIRMATION = 0xBD
}
 Possible BOTA packet types. More...
 

Detailed Description

Common BOTA definitions.

License: Commercial
Version
1.0.3624
Purpose: Bulk Over-The-Air (BOTA) service

Macro Definition Documentation

◆ BOTA_PACKED

#define BOTA_PACKED   __attribute__((packed))

◆ BOTA_STATIC_ASSERT

#define BOTA_STATIC_ASSERT (   ...)    static_assert(__VA_ARGS__)

◆ BOTA_SENDER_MAX_TRANSFERS

#define BOTA_SENDER_MAX_TRANSFERS   2

Maximum number of simultaneous transfers that is supported.

◆ BOTA_SENDER_MAX_MISSING_CHUNKS

#define BOTA_SENDER_MAX_MISSING_CHUNKS   100

Maximum number of missing data chunks that can be tracked at once per transfer.

◆ BOTA_RECIPIENT_MAX_TRANSFERS

#define BOTA_RECIPIENT_MAX_TRANSFERS   2

Maximum number of simultaneous transfers that is supported.

◆ BOTA_RECIPIENT_MAX_MISSING_CHUNKS

#define BOTA_RECIPIENT_MAX_MISSING_CHUNKS   50

Maximum number of missing data chunks that can be tracked at once per transfer.

◆ BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_INTERVAL_MS

#define BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_INTERVAL_MS   45000

BOTA timings - RECIPIENT.

BULK_MISSING.request send time interval

◆ BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_RANDOMIZATION_MS

#define BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_RANDOMIZATION_MS   15000

BULK_MISSING.request randomization (first transmission of BULK_MISSING.request will be after randomized time)

◆ BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_RETRIES

#define BOTA_RECIPIENT_BULK_MISSING_REQUEST_SEND_RETRIES   20

how many times BULK_MISSING.request will be send until transfer abort

◆ BOTA_RECIPIENT_TRANSFER_CONFIRMATION_SEND_RANDOMIZATION_MS

#define BOTA_RECIPIENT_TRANSFER_CONFIRMATION_SEND_RANDOMIZATION_MS   5000

TRANSFER.confirmation randomization.

◆ BOTA_RECIPIENT_VALIDATE_CONFIRMATION_SEND_RANDOMIZATION_MS

#define BOTA_RECIPIENT_VALIDATE_CONFIRMATION_SEND_RANDOMIZATION_MS   5000

VALIDATE.confirmation randomization.

◆ BOTA_RECIPIENT_TRANSFER_TIMEOUT_MS

#define BOTA_RECIPIENT_TRANSFER_TIMEOUT_MS   (24 * 3600 * 1000)

inactivity timeout during transfer that leads to aborting the transfer

◆ BOTA_RECIPIENT_TRANSFER_OVERWRITE_TIMEOUT_MS

#define BOTA_RECIPIENT_TRANSFER_OVERWRITE_TIMEOUT_MS   (5 * 60 * 1000)

inactivity timeout during transfer that makes it possible to overwrite the transfer with new one

◆ BOTA_SENDER_DEFAULT_BULK_WRITE_SENDING_INTERVAL_MS

#define BOTA_SENDER_DEFAULT_BULK_WRITE_SENDING_INTERVAL_MS   3000

Default timings for BOTA Sender.

Default BULK_WRITE.request sending delay (in ms), limits the overall data transfer

◆ BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_SENDING_DELAY_SEC

#define BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_SENDING_DELAY_SEC   20

Default TRANSFER.request sending delay (in seconds) after last TRANSFER.confirmation was received.

◆ BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_PAUSE_SEC

#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_PAUSE_SEC   60

Default value of how long to wait (in seconds) from last BULK_WRITE.request to the first VALIDATE.request.

◆ BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_SENDING_DELAY_SEC

#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_SENDING_DELAY_SEC   20

Default VALIDATE.request sending delay (in seconds) after last VALIDATE.confirmation was received.

◆ BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_RETRIES

#define BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_RETRIES   3

Default setting of how many times TRANSFER.request will be sent.

◆ BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_RETRIES

#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_RETRIES   3

Default setting of how many times VALIDATE.request will be sent.

◆ BOTA_TRANSFER_INVALID

#define BOTA_TRANSFER_INVALID   0

Invalid transfer identifier.

◆ BOTA_MAX_TRANSFER_INFO_SIZE

#define BOTA_MAX_TRANSFER_INFO_SIZE   32

Maximum size of the user data associated with the transfer.

◆ BOTA_CHUNK_SIZE

#define BOTA_CHUNK_SIZE   72

Size of a single data chunk sent in a single UDP packet.

◆ BOTA_MAX_OFFSETS_IN_BULK_MISSING_REQUEST

#define BOTA_MAX_OFFSETS_IN_BULK_MISSING_REQUEST   18

Maximum number of offsets in BULK_MISSING.request packet.

◆ BOTA_DEFAULT_PORT

#define BOTA_DEFAULT_PORT   (0xf0b2)

Default UDP port number for the BOTA service.

◆ BOTA_SENDER_ESTIMATED_TRANSFER_DURATION

#define BOTA_SENDER_ESTIMATED_TRANSFER_DURATION (   bulkSize)
Value:
#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_RETRIES
Default setting of how many times VALIDATE.request will be sent.
Definition: bota_recipient/include/bota_defs.h:75
#define BOTA_SENDER_DEFAULT_BULK_WRITE_SENDING_INTERVAL_MS
Default timings for BOTA Sender.
Definition: bota_recipient/include/bota_defs.h:70
#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_PAUSE_SEC
Default value of how long to wait (in seconds) from last BULK_WRITE.request to the first VALIDATE....
Definition: bota_recipient/include/bota_defs.h:72
#define BOTA_CHUNK_SIZE
Size of a single data chunk sent in a single UDP packet.
Definition: bota_recipient/include/bota_defs.h:86
#define BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_RETRIES
Default setting of how many times TRANSFER.request will be sent.
Definition: bota_recipient/include/bota_defs.h:74
#define BOTA_SENDER_DEFAULT_TRANSFER_VALIDATE_REQUEST_SENDING_DELAY_SEC
Default VALIDATE.request sending delay (in seconds) after last VALIDATE.confirmation was received.
Definition: bota_recipient/include/bota_defs.h:73
#define BOTA_SENDER_DEFAULT_TRANSFER_REQUEST_SENDING_DELAY_SEC
Default TRANSFER.request sending delay (in seconds) after last TRANSFER.confirmation was received.
Definition: bota_recipient/include/bota_defs.h:71

Helper macro to estimate total transfer duration (in ms)

Typedef Documentation

◆ BotaTransferId

typedef uint16_t BotaTransferId

BOTA transfer identifier used to identify and distinguish the transfers.

◆ BotaMemoryAddr

typedef uint32_t BotaMemoryAddr

Address in the Bulk memory.

◆ BotaReadFunc

typedef void(* BotaReadFunc) (BotaMemoryAddr addr, void *dst, size_t size, BotaTransferId transferId)

Function that reads the destination memory for the BOTA service (callback).

Parameters
[in]addraddress from which to read
[in]dstplace to store the read data
[in]sizesize of the data to read (in number of bytes)
[in]transferIdid of the transfer that requests the data

◆ BotaWriteFunc

typedef void(* BotaWriteFunc) (BotaMemoryAddr addr, const void *src, size_t size, BotaTransferId transferId)

Function that writes the destination memory for the BOTA service (callback).

Parameters
[in]addraddress to which to write
[in]srcdata to be written
[in]sizesize of the data to write (in number of bytes)
[in]transferIdid of the transfer that provides the data

◆ BotaTimeFunc

typedef uint64_t(* BotaTimeFunc) (void)

BOTA time provider callback function.

Returns
current time in ms

Enumeration Type Documentation

◆ BotaResult

enum BotaResult

Possible BOTA function results.

Enumerator
BOTA_RESULT_OK 

Success.

BOTA_RESULT_INVALID_INPUT_ARGUMENT 

At least one of the input arguments was invalid.

BOTA_RESULT_FAILED_TO_REGISTER_UDP_SOCKET 

The service failed to register an UDP socket.

BOTA_RESULT_FAILED_TO_REGISTER_NEW_TRANSFER 

The service failed to register a new transfer.

BOTA_RESULT_OK 

Success.

BOTA_RESULT_INVALID_INPUT_ARGUMENT 

At least one of the input arguments was invalid.

BOTA_RESULT_FAILED_TO_REGISTER_UDP_SOCKET 

The service failed to register an UDP socket.

BOTA_RESULT_FAILED_TO_REGISTER_NEW_TRANSFER 

The service failed to register a new transfer.

◆ BotaTransferReaction

Possible recipient reactions to a new BOTA transfer.

Enumerator
BOTA_TRANSFER_REACTION_ACCEPT 

The BOTA transfer should be accepted.

BOTA_TRANSFER_REACTION_REJECT 

The BOTA transfer should be rejected.

BOTA_TRANSFER_REACTION_MARK_AS_RECEIVED 

The BOTA transfer should be marked as already received.

BOTA_TRANSFER_REACTION_ACCEPT 

The BOTA transfer should be accepted.

BOTA_TRANSFER_REACTION_REJECT 

The BOTA transfer should be rejected.

BOTA_TRANSFER_REACTION_MARK_AS_RECEIVED 

The BOTA transfer should be marked as already received.

◆ BotaPacketType

Possible BOTA packet types.

Enumerator
BOTA_PACKET_TYPE_TRANSFER_REQUEST 

TRANSFER.request packet type.

BOTA_PACKET_TYPE_TRANSFER_CONFIRMATION 

TRANSFER.confirmation packet type.

BOTA_PACKET_TYPE_BULK_WRITE_REQUEST 

BULK_WRITE.request packet type.

BOTA_PACKET_TYPE_BULK_MISSING_REQUEST 

BULK_MISSING.request packet type.

BOTA_PACKET_TYPE_BULK_MISSING_CONFIRMATION 

BULK_MISSING.confirmation packet type.

BOTA_PACKET_TYPE_VALIDATE_REQUEST 

VALIDATE.request packet type.

BOTA_PACKET_TYPE_VALIDATE_CONFIRMATION 

VALIDATE.confirmation packet type.

BOTA_PACKET_TYPE_TRANSFER_REQUEST 

TRANSFER.request packet type.

BOTA_PACKET_TYPE_TRANSFER_CONFIRMATION 

TRANSFER.confirmation packet type.

BOTA_PACKET_TYPE_BULK_WRITE_REQUEST 

BULK_WRITE.request packet type.

BOTA_PACKET_TYPE_BULK_MISSING_REQUEST 

BULK_MISSING.request packet type.

BOTA_PACKET_TYPE_BULK_MISSING_CONFIRMATION 

BULK_MISSING.confirmation packet type.

BOTA_PACKET_TYPE_VALIDATE_REQUEST 

VALIDATE.request packet type.

BOTA_PACKET_TYPE_VALIDATE_CONFIRMATION 

VALIDATE.confirmation packet type.

Go to Top